package sg.edu.nus.iss.vmcs.system;

/*
 * Copyright 2011 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

import java.awt.event.*;

/**
 * This class represents the control object that monitors the End Simulation
 * Button and performs actions in response to the button being pressed.
 * It implements ActionListener interface from Java AWT Event Package.
 *
 * @version 1.0  09/12/2011
 * @author Team 7S - SE19
 */

public class EndSimulationButtonListener implements ActionListener {

	private MainController mctrl;

/**
 * This constructor creates an instance of the End Simulation Button Listener.
 * It receives the reference for the Main Controller object.
 * @param mc Reference for Main Controller object.
 * @see MainController
 */	
	
	public EndSimulationButtonListener(MainController mc) {
		mctrl = mc;
	}

/**
 * Invoked when an action occurs in response to the button being pressed. 
 * Implemented as a part of interface.
 * @param e ActionEvent 
 * @see MainController#closeDown()
 */	
	public void actionPerformed(ActionEvent e) {
		/**@todo: Implement this java.awt.event.ActionListener method*/
		mctrl.closeDown();

	}
}